package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.luhuiguo.cms.shared.model.UserModel;

public class LoginEvent extends GwtEvent<LoginEventHandler> {

    public static Type<LoginEventHandler> TYPE = new Type<LoginEventHandler>();

    private UserModel user;

    public LoginEvent(UserModel user) {
        this.user = user;
    }

    @Override
    protected void dispatch(LoginEventHandler handler) {
        handler.onLogin(this);
    }

    @Override
    public GwtEvent.Type<LoginEventHandler> getAssociatedType() {
        return TYPE;
    }

    public UserModel getUser() {
        return user;
    }

}
